<template>
    <Echart
      :options="options"
      id="centreRight2Chart1"
      height="100%"
      width="100%"
    ></Echart>
</template>

<script>
import Echart from '@/common/echart'
export default {
  data () {
    return {
      options: {},
    };
  },
  components: {
    Echart,
  },
  props: {
    cdata: {
      type: Object,
      default: () => ({})
    },
  },
  watch: {
    cdata: {
      handler (newData) {
        // 固定样式数据
        let lineStyle = {
          normal: {
            width: 1,
            opacity: 0.5
          }
        };

        this.options = {
            tooltip: {
                show: true,
                trigger: "item"
            },
            legend: {
                show: true,
                icon: "circle",
                orient: "horizontal",
                bottom: 0,
                textStyle: {
                    /*fontSize: 14,
                    color: "rgb(238, 197, 102)"*/
                },
                data: ["总量", "办结量"]
            },
          radar: {
              center: ["50%", "50%"],
              radius: "60%",
            indicator: newData.indicatorData,
            shape: "circle",
            splitNumber: 5,
            name: {
              textStyle: {
                color: "rgb(238, 197, 102)"
              }
            },
            splitLine: {
              lineStyle: {
                color: [
                  "rgba(238, 197, 102, 0.1)",
                  "rgba(238, 197, 102, 0.2)",
                  "rgba(238, 197, 102, 0.4)",
                  "rgba(238, 197, 102, 0.6)",
                  "rgba(238, 197, 102, 0.8)",
                  "rgba(238, 197, 102, 1)"
                ].reverse()
              }
            },
            splitArea: {
              show: false
            },
            axisLine: {
              lineStyle: {
                color: "rgba(238, 197, 102, 0.5)"
              }
            }
          },
          series: [
            {
              name: "总量",
              type: "radar",
              lineStyle: lineStyle,
              data: newData.dataTotal,
              symbol: "none",
              itemStyle: {
              },
              areaStyle: {
                normal: {
                  opacity: 0.05
                }
              }
            },{
                  name: "办结量",
                  type: "radar",
                  lineStyle: lineStyle,
                  data: newData.data,
                  symbol: "none",
                  itemStyle: {
                  },
                  areaStyle: {
                      normal: {
                          opacity: 0.05
                      }
                  }
              }
            //end
          ]
        }
      },
      immediate: true,
      deep: true
    }
  }
};
</script>

<style lang="scss" scoped>
</style>
